﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{
	public sealed class SymbolState
	{

	  /// <summary>
	  /// ONLINE, OFFLINE, SUSPEND.
	  /// </summary>
	  public static readonly SymbolState ONLINE = new SymbolState("ONLINE", InnerEnum.ONLINE, "online");
	  public static readonly SymbolState OFFLINE = new SymbolState("OFFLINE", InnerEnum.OFFLINE, "offline");
	  public static readonly SymbolState SUSPEND = new SymbolState("SUSPEND", InnerEnum.SUSPEND, "suspend");

	  private static readonly IList<SymbolState> valueList = new List<SymbolState>();

	  static SymbolState()
	  {
		  valueList.Add(ONLINE);
		  valueList.Add(OFFLINE);
		  valueList.Add(SUSPEND);
	  }

	  public enum InnerEnum
	  {
		  ONLINE,
		  OFFLINE,
		  SUSPEND
	  }

	  public readonly InnerEnum innerEnumValue;
	  private readonly string nameValue;
	  private readonly int ordinalValue;
	  private static int nextOrdinal = 0;
	  private readonly string state;

	  internal SymbolState(string name, InnerEnum innerEnum, string state)
	  {
		this.state = state;

		  nameValue = name;
		  ordinalValue = nextOrdinal++;
		  innerEnumValue = innerEnum;
	  }

	  public string State
	  {
		  get
		  {
			return state;
		  }
	  }

	  public static SymbolState find(string state)
	  {
		foreach (SymbolState st in SymbolState.values())
		{
		  if (st.State.Equals(state))
		  {
			return st;
		  }
		}
		return null;
	  }


		public static IList<SymbolState> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public override string ToString()
		{
			return nameValue;
		}

		public static SymbolState valueOf(string name)
		{
			foreach (SymbolState enumInstance in SymbolState.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}